;(function(){

var avalon_skill = {
	//角色类别标识
	league_role:"avalon",
	//设置某成员为管理员
	setAdmin:function(bus_id){
		var league = this.getLeague();
		league._addAdmin(bus_id);
	},
	//删除管理员
	removeAdmin:function(bus_id){
		var league = this.getLeague();
		league._removeAdmin(bus_id);
	},
	//非安全，解散联盟
	_dismissLeague:function () {
		var league = this.getLeague();

		//移除所以成员
		var merchants = (league.merchants||[]).slice();
		this.removeMerchants(merchants);
		//将盟主的角色滞空
		this.league = null;
		//销毁销售方案
		var markets = this.markets||[];
		markets.slice().forEach(function(market_id){
			var market = league._getMarket(market_id);
			league._removeMarket(market._id);
			market.destroy();
		});
		//销毁联盟其余信息
		league.destroy();
	},
	//修改联盟详情
	updateLeagueInfo:function (leagueInfo) {
		var league = this.getLeague();
		league.setInfo(leagueInfo);
	}
};
var admin_skill = require("./admin.skill");

Object.keys(admin_skill).forEach(function(key){
	avalon_skill[key]||(avalon_skill[key] = admin_skill[key]);
});
module.exports = avalon_skill;
}());